﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using MixScriptWeb.control;
using MixScriptWeb.Share;
using MixScript.BLL;

namespace MixScriptWeb.Jideco.MM
{
    public partial class StokCard : cCommonWeb
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                addFindClickAttribute(this, new MixScriptTB[] { txtMaterialID, txtwrhcode }, new string[] { "SRCMAT", "SRCWRHID" });
               
                ddlMonth.SelectedValue = DateTime.Now.Month.ToString();
                ddlTahun.SelectedValue = DateTime.Now.Year.ToString();
                
                txtMaterialID.Tbx.Attributes.Add("readonly", "readonly");
                txtwrhcode.Tbx.Attributes.Add("readonly", "readonly");
            }
        }

        protected void btnPrint_Click(object sender, EventArgs e)
        {
            
            
            string sscript = "";
            sscript += "<script>";
            sscript += "window.open('../print/rptid-13,m-" + txtMaterialID.Text + ",w-" + txtwrhcode.Text + ",b-" + ddlMonth.SelectedValue + ",t-" + ddlTahun.SelectedValue + ",dl.html', '_blank');";
            sscript += "</script>";
            ClientScript.RegisterStartupScript(GetType(), "report", sscript);        
        }
    }
}